import axios from "axios";

const instance = axios.create({
    baseURL: '/api',
    timeout: 30000
})

instance.interceptors.request.use((config) => {
    return config;
}, error => {
    return Promise.reject(error)
})
instance.interceptors.response.use(resp => {
    // 处理状态码失败
    return resp.data;
}, error => {
    // 处理网络问题
    return Promise.reject(error)
})
export default instance;